fb_ids <-
function(Genus = NA, Species = NA, server = 'http://www.fishbase.tw/', ...)
	{
require("XML")
require("stringr")
require('RCurl')
  if (is.na(Genus) | is.na(Species))
    {
    warning("Genus and Specie are required!")
    }
  if(!is.na(Genus) & !is.na(Species))
    {
    url <- paste(server, "Summary/", Genus, "-", Species, ".html", sep = "")
	  doc <- htmlParse(url) ## I got the file as a XML class
  	a <- readHTMLTable(doc)
  	a <- length(a)
  	StockCode <- NA
  	idFB <- NA
  	if (a!=0)
  		{
  		StockCode <- as.numeric(strsplit(strsplit(toString.XMLNode(doc), 'StockCode=')[[1]][3], '\"')[[1]][1])
  		idFB <- as.numeric(strsplit(strsplit(toString.XMLNode(getNodeSet(doc, "//a[@title='English']")[[1]]), '?id=')[[1]][2],'&')[[1]][1])
  		}
  	ids <- data.frame(Genus=Genus, Species=Species, idFB = as.numeric(idFB), StockCode = as.numeric(StockCode))
  }
	return(as.data.frame(ids))
	}
